from abc import abstractmethod

import page.page as page
from links.socket_ui import SocketUI


class SocketPage(page.AbstractPage):
    def __init__(self, parent):
        super().__init__(parent)
        self.is_client = False
        self.is_web_socket = False

    def create_controller(self, io_settings):
        controller = SocketUI(io_settings)
        if self.is_client:
            controller.hide_something_for_client()
            if not self.is_web_socket:
                controller.hide_something_for_is_not_web_socket()
        else:
            controller.hide_something_for_server()
            controller.hide_something_for_is_not_web_socket()

        return controller
